package com.database.management.common;

import java.io.Serializable;

/**
 * Result : 响应的结果对象
 *
 * @author LiuZhaohui
 * @since 2014-09-27 16:28
 */
public class Result implements Serializable {
    private static final long serialVersionUID = 6288374846131788743L;

    /**
     * 信息
     */
    private String message;

    /**
     * 状态码
     */
    private int statusCode;

    /**
     * 是否成功
     */
    private Object result;


    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    
    public void setSuccess(String message) {
    	  this.statusCode = ResultCode.DB_SUCCESS.getCode();
    	if(message == null){
    		this.message = ResultCode.DB_SUCCESS.getMessage();
    	}else{
    		this.message = message;
    	}
    }
    
    public void setError(String message) {
        this.message = message;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

	public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

	public Result() {

    }
}
